package com.demo.service;

import com.demo.pojo.dto.ScheduleListDTO;
import com.demo.pojo.entity.Grade;
import com.demo.pojo.entity.Student;
import com.demo.pojo.entity.Teacher;

import java.util.List;
import java.util.Map;

/**
 * 教师用户服务接口
 */
public interface TeacherUserService {
    
    /**
     * 教师登录
     */
    Teacher teacherLogin(String teNo, String password);
    
    /**
     * 获取教师个人信息
     */
    Teacher getTeacherInfo(Long teacherId);
    
    /**
     * 更新教师个人信息
     */
    boolean updateTeacherInfo(Teacher teacher);
    
    /**
     * 获取教师课表
     */
    List<ScheduleListDTO> getTeacherSchedule(Long teacherId, String semester);
    
    /**
     * 获取教师本周课表
     */
    List<ScheduleListDTO> getTeacherWeekSchedule(Long teacherId, String semester, Integer weekNo);
    
    /**
     * 获取教师今日课表
     */
    List<ScheduleListDTO> getTeacherTodaySchedule(Long teacherId, String semester, Integer weekNo, Integer dayOfWeek);
    
    /**
     * 申请调课
     */
    boolean applyScheduleChange(Long scheduleId, String reason, Long newTimeSlotId, Long newClassroomId);
    
    /**
     * 获取教师工作量统计
     */
    Map<String, Object> getTeacherWorkloadStats(Long teacherId, String semester);
    
    /**
     * 获取教师时间偏好
     */
    Map<String, Object> getTeacherTimePreference(Long teacherId);
    
    /**
     * 设置教师时间偏好
     */
    boolean setTeacherTimePreference(Long teacherId, Map<String, Object> preferences);
    
    /**
     * 获取教师的学生列表
     */
    List<Map<String, Object>> getTeacherStudents(Long teacherId, String semester);
    
    // ==================== 成绩管理相关方法 ====================
    
    /**
     * 获取教师的成绩列表
     */
    List<Map<String, Object>> getTeacherGrades(Long teacherId, String semester, Long courseId, 
                                               Long clazzId, String studentName, Integer status);
    
    /**
     * 获取教师的课程列表
     */
    List<Map<String, Object>> getTeacherCourses(Long teacherId, String semester);
    
    /**
     * 获取课程的班级列表
     */
    List<Map<String, Object>> getCourseClasses(Long teacherId, Long courseId, String semester);
    
    /**
     * 获取班级的学生列表
     */
    List<Map<String, Object>> getClassStudents(Long clazzId, Long courseId);
    
    /**
     * 添加成绩
     */
    boolean addGrade(Grade grade);
    
    /**
     * 更新成绩
     */
    boolean updateGrade(Grade grade);
    
    /**
     * 删除成绩
     */
    boolean deleteGrade(Long gradeId);
    
    /**
     * 批量添加成绩
     */
    boolean batchAddGrades(List<Grade> grades);
    
    // ==================== 选课审核相关方法 ====================
    
    /**
     * 获取待审核的选课申请列表
     * @param teacherId 教师ID
     * @param semester 学期
     * @return 待审核的选课申请列表
     */
    List<Map<String, Object>> getPendingCourseApplications(Long teacherId, String semester);
    
    /**
     * 审核选课申请
     * @param studentCourseId 选课记录ID
     * @param approved 是否通过（true=通过，false=拒绝）
     * @param rejectReason 拒绝原因（拒绝时填写）
     * @return 是否成功
     */
    boolean reviewCourseApplication(Long studentCourseId, boolean approved, String rejectReason);
}
























